//页面三级权限
import {
    mapState
} from 'vuex';

export default {
    data() {
        return {
            operations: [],
            noChildMunuList: ['']
        };
    },
    created() {
        this.getOperation();
    },
    computed: {
        ...mapState(['operationList'])
    },
    methods: {
        getOperation() {
            const { meta} = this.$route;
            console.log(this.operationList,"111111111111")
            this.operationList.forEach(item => {
                if (meta.length > 1) {
                    if (!this.noChildMunuList.includes(item.name) && meta[meta.length - 1].name === item.name) {
                        console.log( item.operations,"00000000")
                        this.operations = item.operations.map(val => val.menu_name);
                        console.log(this.operations, "747474747")
                    } else if (this.noChildMunuList.includes(item.name) && meta[0].name === item.name) {
                        this.operations = item.operations.map(val => val.menu_name);
                        console.log(this.operations, "8686868686")
                    }
                }
            });
        }
    }
};
